package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.io.handler.h;
import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.internal.tasks.d;
import com.esri.core.io.EsriServiceException;
import com.esri.core.io.UserCredentials;
import java.util.Map;

/* loaded from: classes.dex */
class GPJobStatusTask extends d<GPJobResource> {
    private static final long serialVersionUID = 1;

    public GPJobStatusTask(GPJobStatusParameters gPJobStatusParameters, String str, UserCredentials userCredentials, TaskListener<GPJobResource> taskListener) {
        super(gPJobStatusParameters, str, userCredentials, taskListener);
        if (gPJobStatusParameters == null) {
            throw new EsriServiceException("The geoprocess task requires input parameters");
        }
        if (gPJobStatusParameters.validate()) {
            setActionInput(gPJobStatusParameters);
        }
    }

    public GPJobStatusTask(GPJobStatusParameters gPJobStatusParameters, String str, UserCredentials userCredentials) {
        this(gPJobStatusParameters, str, userCredentials, null);
    }

    @Override // com.esri.core.internal.tasks.a
    public GPJobResource execute() throws Exception {
        return GPJobResource.fromJson(h.a(this.serviceURL + "/jobs/" + ((GPJobStatusParameters) getActionInput()).getJobId(), (Map<String, String>) null, getServiceCredentials()));
    }
}
